package com.huaxin.hxmoduleworkorder.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxmoduleworkorder.common.enums.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@TableName("order_notification")
@EqualsAndHashCode(callSuper = true)
public class OrderNotification extends BaseModel {
    @TableField(value = "order_type")
    @Schema(description = "工单类型：inspection（巡查）/maintenance（维修）/install（安装）", example = "maintenance")
    private OrderType orderType;

    @TableField(value = "order_id")
    @Schema(description = "工单ID", example = "mnt_order_001")
    private String orderId;

    @TableField(value = "order_electrician_task_id")
    @Schema(description = "工单电工任务ID", example = "mnt_order_electrician_task_001")
    private String orderElectricianTaskId;

    @TableField(value = "recipient_id")
    @Schema(description = "接收人ID", example = "e1001")
    private String recipientId;

    @TableField(value = "recipient_role")
    @Schema(description = "接收人角色：electrician/admin/customer", example = "electrician")
    private OrderNotificationRecipientRole recipientRole;

    @TableField(value = "notification_type")
    @Schema(description = "通知方式：sms/app_push/email/in_system", example = "app_push")
    private OrderNotificationType notificationType;

    @TableField(value = "content")
    @Schema(description = "通知内容", example = "您有一个新的维修工单待处理")
    private String content;

    @TableField(value = "send_status")
    @Schema(description = "发送状态：pending/sent/failed", example = "sent")
    private InspectionSendStatus sendStatus;

    @TableField(value = "read_status")
    @Schema(description = "阅读状态：unread/read", example = "unread")
    private InspectionReadStatus readStatus;

    @TableField(value = "send_time")
    @Schema(description = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime sendTime;
}

